/*
    Superjuego Engine
    Copyright (C) 2011 Jorge Luís Cabral y Gabriel Ernesto Cabral

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    Contact: baigosoft@hotmail.com

*/

#ifndef TIMER_H_
#define TIMER_H_

//#include <stdio.h>


#ifdef DREAMCAST
#include "kos.h"
#define SE_timems uint64
#else
#define SE_timems int
#endif


/*Estructura para controlar eventos*/
typedef struct{
SE_timems time_start;
SE_timems time_end;

}SE_timer;

/*obtener el tiempo actual (en milisegundos)*/
SE_timems SE_timer_gettime();

/*Resetear timer*/
void SE_timer_reset();

/*Obtener tiempo actual (en milisegundos)*/
SE_timems SE_timer_current();

/*Setear framerate fijo*/
void SE_timer_setframerate(int framespersecond);

/*Esperar para cumplir con el framerate*/
void SE_timer_waitframerate();

/*Crear un timer nuevo*/
SE_timer *SE_timer_start(int time_end);

/*Chequear un timer. Retorna 1 si se sobrepaso el tiempo final y 0 en caso contrario*/
int SE_timer_check(SE_timer *timer);


#endif

